import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    userinfo:{},
    currentpath:'/base',   //当前的路由路径
    currentmenu:[
    {
      index:'/home',
      name:'首页',
      icon:'el-icon-s-home'
    },
    {
      index:'/user',
      name:'用户管理',
      icon:'el-icon-user'
    },{
      index:'/activityList',
      name:'活动列表',
      icon:'el-icon-trophy'
    },{
      index: "/commodityList",
      name: "商品列表",
      icon: "el-icon-goods",
    },{
      index: "/courseList",
      name: "课程列表",
      icon: "el-icon-school",
    },{
      index: "/orderList",
      name: "订单列表",
      icon: "el-icon-s-order",
    },{
      index: "/placeList",
      name: "场地列表",
      icon: "el-icon-place",
    }],
    friendList:[],   //好友列表
    RoomMessage:[],
  },
  mutations: {
    changeMenu(state,payload){
      state.currentmenu=payload.menu
    },
    setUserId(state,payload){
      state.userinfo=payload.userinfo
    },
    setFriendList(state,payload){
      state.friendList=payload
    },
    setRoomMessage(state,payload){
      state.RoomMessage=payload
    },
  },
  actions: {
  },
  modules: {
  }
})
